package com.uzai.common.enums.mini;

import java.util.Objects;

/**
 * The enum Mini order status.
 *
 * @author mingyang.chen create in 2023/11/1 17:09
 */
public enum MiniOrderServiceReason {

    // 1:不喜欢/不想要, 2:与商家协商一致退款, 3:货物破损拒绝签收, 4:快递一直未送达, 5:退运费, 6:商品包装破损, 7:少发/漏发, 8:质量问题, 9:商家发错货
    /**
     * 仅退款
     */
    NOT_LIKE(1, "不喜欢/不想要"),
    /**
     * 退货退款
     */
    CHAT_REFUND(2, "与商家协商一致退款"),
    /**
     * 换货
     */
    ITEM_FAIL(3, "货物破损拒绝签收"),

    NO_RECEIVE(4, "快递一直未送达"),

    REFUND_EXPRESS_AMOUNT(5, "退运费"),

    PACKAGE_FAIL(6, "商品包装破损"),

    LESS_MISSING_HAIR(7, "少发/漏发"),

    QUALITY_ISSUES(8, "质量问题"),

    ERROR_ITEM(9, "商家发错货"),

    ;

    private Integer code;
    private String desc;

    MiniOrderServiceReason(Integer code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public static MiniOrderServiceReason getByCode(Integer code) {
        for (MiniOrderServiceReason value : MiniOrderServiceReason.values()) {
            if (Objects.equals(value.code, code)) {
                return value;
            }
        }
        return null;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }

    /**
     * Gets code.
     *
     * @return the code
     */
    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }
}
